/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: bold;
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.2s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* 按钮样式 */
.btn {
    border-radius: 0.375rem;
    border: none;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* 表单样式 */
.form-control {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: all 0.2s ease-in-out;
}

.form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* 侧边栏样式 */
.sidebar {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.sidebar .nav-link {
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    padding: 0.75rem 1rem;
    color: #495057;
    transition: all 0.2s ease-in-out;
}

.sidebar .nav-link:hover {
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background-color: #0d6efd;
    color: white;
}

/* 头像圆圈 */
.avatar-circle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* 图谱容器样式 */
.graph-container {
    background: #ffffff;
    border-radius: 0.5rem;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 1rem;
    border: 1px solid #e9ecef;
}

/* 控制面板样式 */
.control-panel {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 0 0.5rem 0.5rem 0;
}

.control-panel .form-control-sm {
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.control-panel .form-range {
    cursor: pointer;
}

.control-panel .form-range::-webkit-slider-thumb {
    background: #0d6efd;
    border-radius: 50%;
    cursor: pointer;
}

.control-panel .form-range::-moz-range-thumb {
    background: #0d6efd;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* 统计信息样式 */
.stats {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0.375rem;
    padding: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* 模态框样式 */
.modal-content {
    border-radius: 0.75rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.75rem 0.75rem 0 0;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0 0 0.75rem 0.75rem;
}

/* 测试题目样式 */
.quiz-question {
    background: #ffffff;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
}

.quiz-question:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.quiz-option label {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
    display: block;
    margin: 0;
}

.quiz-option label:hover {
    background-color: #f8f9fa;
}

.quiz-option input[type="radio"] {
    margin-right: 0.5rem;
}

/* 正确/错误答案样式 */
.correct-answer {
    border-color: #198754 !important;
    background: linear-gradient(135deg, #d1e7dd 0%, #a3cfbb 100%);
}

.wrong-answer {
    border-color: #dc3545 !important;
    background: linear-gradient(135deg, #f8d7da 0%, #f1aeb5 100%);
}

/* 加载动画 */
.spinner-border {
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease-in-out;
    }

    .sidebar.show {
        left: 0;
    }

    .graph-container {
        margin: 0;
        border-radius: 0;
        height: calc(100vh - 120px);
    }

    .control-panel {
        border-radius: 0;
    }
}

/* SVG图形样式 */
.node {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: all 0.2s ease-in-out;
}

.node:hover {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.link {
    transition: all 0.2s ease-in-out;
}

.node-label {
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    font-family: 'Segoe UI', sans-serif;
}

.highlighted {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        stroke-width: 4px;
    }
    50% {
        stroke-width: 6px;
    }
    100% {
        stroke-width: 4px;
    }
}

/* 工具提示样式 */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    pointer-events: none;
    z-index: 1000;
}

/* 上传区域样式 */
.upload-area {
    border: 2px dashed #ced4da;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.05);
}

.upload-area.dragover {
    border-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
}

/* 特色图标样式 */
.feature-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* 英雄区域样式 */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-in-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 打印样式 */
@media print {
    .sidebar,
    .control-panel,
    .navbar {
        display: none !important;
    }

    .graph-container {
        margin: 0 !important;
        height: auto !important;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }

    .btn {
        border: 2px solid;
    }

    .node {
        stroke-width: 3px;
    }
}